<?php

get_header();
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$q = array( 'paged' => $paged,'gdsr_sort' => 'votes', 'gdsr_order' => 'desc' );
 query_posts($q);
?>
<div id="contenuti">
    
     
     <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
     <div>
         
     <?php the_title('<h1>','</h1>'); ?>
         <?php excerpt(); ?>
         
         <?php wp_gdsr_render_article(); ?>
         
     </div>
     
     <?php endwhile; ?>
      <div class="paginazione" >
                <?php
                $big = 999999999; //questo è da vedere bene...
                echo paginate_links(array(
                    'base' => str_replace($big, '%#%', get_pagenum_link($big)),
                    'format' => '?paged=%#%',
                    'current' => max(1, get_query_var('paged')),
                    'total' => $wp_query->max_num_pages
                ));
                ?>
                </div>
     <?php endif; ?>
</div>


<?php
get_footer();
?>
